package com.lantosec.hmrp.modules.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.system.vo.SysRoleVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 用户角色表 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysRole extends BaseEntity<SysRoleVO> {

    private static final long serialVersionUID = 1L;
    public SysRole(SysRoleVO vo){
        this.roleId = vo.getRoleId();
        this.roleName = vo.getRoleName();
        this.state = vo.getState();
        this.remark = vo.getRemark();
    }

    @Override
    public SysRoleVO convertToVO(){
        return new SysRoleVO(this);
    }


    /**
     * 角色ID
     */
    @TableId(value = "role_id", type = IdType.ASSIGN_UUID)
    private String roleId;

    /**
     * 角色名称
     */
    private String roleName;

    /**
     * 状态(0正常，1废止)
     */
    private Integer state;

    /**
     * 角色说明
     */
    private String remark;

    @TableField(exist = false)
    private String menuId;

    @TableField(exist = false)
    private String sysPermissionId;


    public enum ColName {
        role_id, role_name, state, remark, 
    }
}
